<?php

namespace app\index\controller\ad;

use app\index\service\TokenPlanService;
use ShidianUtil\Thinkphp\Response\ApiResponse;
use think\APP;
use think\Request as Request;

/**
 * TokenPlan 控制器
 * Class TokenPlan
 * @package app\index\controller\ad;
 * @link https://www.kancloud.cn/manual/thinkphp6_0/1037509
 * @see \app\index\validate\ad\TokenPlan
 */
class TokenPlan
{
    // 请求参数
    private Request $request;

    // service
    private TokenPlanService $service;

    public function __construct(Request $request, TokenPlanService $tokenPlanService)
    {
        $this->request = $request;
        $this->service = $tokenPlanService;
    }

    /**
     * 详情
     * @return ApiResponse
     * @url /ad/token_plan/read
     */
    public function read(): ApiResponse
    {
        return ApiResponse::success($this->service->readOfH5());
    }

}
